package com.mobilepoc.jersey;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.mobilepoc.jersey.model.TransactionWrapper;
import com.mobilepoc.jersey.storage.TransactionStorage;

@Path("/transactions")
public class TransactionRetriever {

    @GET
    @Path("/{accountno}/{transactionsDisplayedCurrently}")
    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
    public TransactionWrapper getOneAccount(@PathParam("accountno") String accountNumber,
            @PathParam("transactionsDisplayedCurrently") String transactionsDisplayedCurrently) throws InterruptedException {
    	Thread.sleep(500);
        return TransactionStorage.getTransactions(accountNumber, Integer.valueOf(transactionsDisplayedCurrently));
    }

}
